<template>
  <div>
    <!-- 头部区域 -->
    <div class="header">
      <!-- 头部左区域（左箭头） -->
      <div class="header-left">
        <!-- 左箭头 -->
        <div class="left-icon iconfont">&#xe602;</div>
      </div>
      <!-- 头部输入区域 -->
      <div class="header-input">
        <!-- 放大镜icon -->
        <span class="iconfont input-icon">&#xe637;</span>
        <!-- 输入框 -->
        <input type="text" placeholder="请输入景点/城市/游玩主题" />
      </div>
      <!-- 头部右区域（城市及其选择） -->
      <router-link to="/city">
        <div class="header-right">
          <span class="area-name">{{this.city}}</span>
          <!-- 选择下箭头 -->
          <span class="iconfont icon-right">&#xe6b5;</span>
        </div>
      </router-link>
    </div>
  </div>
</template>

<script>
import { mapState } from 'vuex'
export default {
  props: [],
  methods: {},
  computed: {
    /* vuex简化代码 */
    ...mapState({
      city: 'city'
    })
  }
}
</script>

<style lang="stylus" scoped>
@import '~styles/varibles.styl'
1rem = html font-size = 50px
input::placeholder {
  color: #d6d5d5;
}
.header {
  display: flex;
  flex-direction: row;
  height: 0.86rem;
  line-height: 0.86rem;
  color: #fff;
  background-color: $bgColor;
}
.header-left {
  color: #fff;
  width: 0.64rem;
  display: flex;
  justify-content: center;
}
.left-icon {
  font-size: 0.5rem;
}
.header-input {
  padding-left: 0.2rem;
  display: flex;
  color: #d6d5d5;
  margin: 0.12rem 0 0.12rem 0.2rem;
  flex: 1;
  height: 0.64rem;
  line-height: 0.64rem;
  background-color: #fff;
  border-radius: 0.1rem;
}
.input-icon {
  padding-top: 0.025rem;
  font-size: 0.4rem;
  padding-right: 0.1rem;
}
.header-right {
  width: 1.24rem;
  display: flex;
  justify-content: center;
  color: #fff
}
.icon-right {
  padding-left: 0.1rem;
}
</style>
